#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int n, m;
const int N = 1010, M = 30;
struct point {
  ll x, y;
} A[N], B[N];
ll a, b, c;
int cnta, cntb;
int stata[2], statb[2];
void eval(point arr[], int cnt, int stat[]) {
  for (int i = 0; i < cnt; ++i) {
    auto x = arr[i].x, y = arr[i].y;
    ll res = a + b * x + c * y;
    if (res > 0)
      stat[1]++;
    else
      stat[0]++;
  }
}
int main() {
  cin >> n >> m;
  for (int i = 0; i < n; ++i) {
    ll x, y;
    char ch;
    cin >> x >> y >> ch;
    if (ch == 'A')
      A[cnta++] = {x, y};
    else
      B[cntb++] = {x, y};
  }
  for (int i = 0; i < m; ++i) {
    cin >> a >> b >> c;
    memset(stata, 0, sizeof(stata));
    memset(statb, 0, sizeof(statb));
    eval(A, cnta, stata);
    eval(B, cntb, statb);
    if ((stata[0] && !stata[1] && !statb[0] && statb[1]) ||
        (!stata[0] && stata[1] && statb[0] && !statb[1])) {
      cout << "Yes\n";
    } else
      cout << "No\n";
  }
}
